From: Jonas Ã…dahl Date: Mon, 15 Jul 2024 19:28:58 +0000 (+0200) Subject: st/theme-node-drawing: Fix corner pipeline leak X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~219^2^2~41 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=deb9f05303613ff7ab5ae440a4199e1d2806caff;p=gnome-shell.git st/theme-node-drawing: Fix corner pipeline leak The corner pipelines state theme node paint state was not necessarily free of existing pipelines, so make sure to free them before looking up new ones. This avoids leaking thousands of CoglPipeline instances after toggling the overview a bunch of times. Fixes: e1868cab1a ("st/theme-node-drawing: Factor in border radius in update_resources()") Part-of: --- diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c index 778ebd9bd..5933b3a3b 100644 --- a/src/st/st-theme-node-drawing.c +++ b/src/st/st-theme-node-drawing.c @@ -1374,6 +1374,7 @@ st_theme_node_maybe_prerender_background (StThemeNodePaintState *state, gboolean has_inset_box_shadow; gboolean has_large_corners; StShadow *box_shadow_spec; + StCorner corner_id; box_shadow_spec = st_theme_node_get_box_shadow (node); @@ -1416,6 +1417,9 @@ st_theme_node_maybe_prerender_background (StThemeNodePaintState *state, } } + for (corner_id = 0; corner_id < 4; corner_id++) + g_clear_object (&state->corner_pipeline[corner_id]); + state->corner_pipeline[ST_CORNER_TOPLEFT] = st_theme_node_lookup_corner (node, width, height, resource_scale, ST_CORNER_TOPLEFT); state->corner_pipeline[ST_CORNER_TOPRIGHT] =